package com.lanling.eduservice.config;

import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 胡振华
 * @date 2020-10-03 10:37
 */
@Configuration
@MapperScan("com.lanling.eduservice.mapper")
public class MyConfig {

    /**
     * 配置逻辑删除的插件
     * @return
     */
    @Bean
    public ISqlInjector getISqlInjector(){
        return new LogicSqlInjector();
    }

    @Bean
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }

}